<?php
defined('BASEPATH') OR exit('No direct script access allowed');//防止直接访问这个问价

class Welcome extends CI_Controller {

	/**
	 * Index Page for this controller.
	 *
	 * Maps to the following URL
	 * 		http://example.com/index.php/welcome
	 *	- or -
	 * 		http://example.com/index.php/welcome/index
	 *	- or -
	 * Since this controller is set as the default controller in
	 * config/routes.php, it's displayed at http://example.com/
	 *
	 * So any other public methods not prefixed with an underscore will
	 * map to /index.php/welcome/<method_name>
	 * @see https://codeigniter.com/user_guide/general/urls.html
	 */
	public function index()
	{
		// 分配数据到视图当中
		$data['title']='CI框架';
		$data['content']='CI是一个小巧的框架，速度无敌';

		// 载入视图
		$this->load->view('welcome',$data);//为什么在这里分配的是一个数组，在模板中可以直接用数组的键访问，因为extract()会把数组变成一个符号表，在符号表中，数组中键名当做变量，值作为变量的值
	}
}
